var express = require('express');
var router = express.Router();
const <%= humpTableName%>Controller = require("../../controllers/<%= pascTableName%>Controller");
/**
 * @typedef Response
 * @property {integer} code.required - 状态码，成功200，失败500 - eg:200
 * @property {string} data.required - json对象数据 - eg:{}
 * @property {string} msg.required - 提示信息 - eg:提示信息
 */
/**
 * @typedef List<%= pascTableName%>
 * @property {integer} pageNo.required - 当前页数 - eg:1
 * @property {integer} pageSize.required - 每页记录数 - eg:2
 */
/**
 * @typedef Add<%= pascTableName%><% for(var i =0;i<columnInfo.length;i++){ %>
 * @property {<%= columnInfo[i].DATA_TYPE%>} <%= columnInfo[i].COLUMN_NAME%> - <%= columnInfo[i].COLUMN_COMMENT%> - eg:<% }%>
 */
/**
 * 分页查询
 * @route Post /<%= tableName%>/list<%= tableName%>
 * @group <%= cnTableName%> - 关于<%= cnTableName%>的相关接口
 * @param {List<%= pascTableName%>.model} List<%= pascTableName%>.body - json对象
 * @returns {Response.model} 200 - 登录接口返回的json对象数据 
 * @security JWT
 * @returns {Error}  default - Unexpected error
 */
router.post('/list<%= tableName%>', <%= humpTableName%>Controller.list);
/**
 * 添加
 * @route Post /<%= tableName%>/add<%= tableName%>
 * @group <%= cnTableName%> - 关于<%= cnTableName%>的相关接口
 * @param {Add<%= pascTableName%>.model} Add<%= pascTableName%>.body - json对象
 * @returns {Response.model} 200 - 登录接口返回的json对象数据 
 * @security JWT
 * @returns {Error}  default - Unexpected error
 */
router.post('/add<%= tableName%>',<%= humpTableName%>Controller.add);
/**
 * 根据id查询
 * @route Post /<%= tableName%>/one<%= tableName%>
 * @group <%= cnTableName%> - 关于<%= cnTableName%>的相关接口
 * @param {Add<%= humpTableName%>.model} id.body.required - json对象,只需要id
 * @returns {Response.model} 200 - 登录接口返回的json对象数据 
 * @security JWT
 * @returns {Error}  default - Unexpected error
 */
router.post('/one<%= tableName%>',<%= humpTableName%>Controller.findById);
/**
 * 更新
 * @route Post /<%= tableName%>/upd<%= tableName%>
 * @group <%= cnTableName%> - 关于<%= cnTableName%>的相关接口
 * @param {Add<%= humpTableName%>.model} Add<%= humpTableName%>.body - json对象，更新需要传主键id
 * @returns {Response.model} 200 - 登录接口返回的json对象数据 
 * @security JWT
 * @returns {Error}  default - Unexpected error
 */
router.post('/upd<%= tableName%>',<%= humpTableName%>Controller.upd);
/**
 * 根据id删除
 * @route Post /<%= tableName%>/del<%= tableName%>
 * @group <%= cnTableName%> - 关于<%= cnTableName%>的相关接口
 * @param {Add<%= humpTableName%>.model} id.body.required - json对象,只需要id
 * @returns {Response.model} 200 - 登录接口返回的json对象数据 
 * @security JWT
 * @returns {Error}  default - Unexpected error
 */
router.post('/del<%= tableName%>',<%= humpTableName%>Controller.del);

module.exports = router;